package com.example.demo1.util;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author jyangzi5
 * @version 1.0
 * @description: TODO
 * @date 2021/4/19 14:06
 */
public class Test {

    public static void main(String[] args) {
        AtomicInteger count = new AtomicInteger(10);
        count.compareAndSet(10, 0);
        System.out.println("count1 = " + count.getAndIncrement()) ;
        System.out.println("count2 = " + count.getAndIncrement()) ;
    }
}
